<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Promise-封装 | 1 - 初始结构搭建</title>
    <script src="./promise.js"></script>
</head>
<body>
    <script>
    
		var ok1 = new Promise( (resolve, reject) => {
			resolve('success ok1')
		})

		var ok2 = new Promise( (resolve, reject) => {
			resolve(ok1)
		})

		var ok3 = new Promise( (resolve, reject) => {
			reject(ok2)
		})

		var failed1 = new Promise( (resolve, reject) => {
			reject(ok3)
		})

		var failed2 = new Promise( (resolve, reject) => {
			reject(ok3)
		})
		var ok4 = new Promise( (resolve, reject) => {
			resolve(failed2)
		})
		// 成功的promise 包裹粗我的promise        
		var p4 = Promise.resolve(ok4);
      	console.log("p4 = ", p4);


    </script>
</body>
</html>